package com.cskaoyan.servlet;

import com.cskaoyan.mapper.CskaoyanLogMapper;
import com.cskaoyan.model.CskaoyanLog;
import com.cskaoyan.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


public class Insert {
    @WebServlet("/")
    public class insert extends HttpServlet{
        @Override
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

            String requestURI = request.getRequestURI();
            System.out.println(requestURI);
            String contextPath = request.getContextPath();
            String servletPath = request.getServletPath();
            String queryString = request.getQueryString();

            SqlSession sqlSession = MyBatisUtil.getSqlSession();
            CskaoyanLog mapper = sqlSession.getMapper(CskaoyanLog.class);
            //将header封装为对象
            //调用对应的SQL语句、进行插入
            //Insert.insert()
        }
    }
}
